var bool = false;
function checkLogin(){
	var url=null;
	var message=null;
	if (arguments.length == 2){
		url=arguments[0];
		message=arguments[1];
	}else if (arguments.length == 1){
		message=arguments[0];
	}
	
	$.ajax({
		"url":"../user/checkLogin.action",
		"type":"post",
		"dataType":"json",
		"success":function(ok,status){
			if (!ok){
				var truthBeTold = window.confirm(message);
				if (truthBeTold) {
					window.location="../user/login_form.jsp";
				}else{
					bool = false;
				}
			}else{
				if (url!=null && url!=""){
					window.location=url;
				}else{
					bool=true;
				}
				
			}
		},
		"async":true});
	if (url==null || url==""){
		return bool;
	}
}